home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: Leap Years
- Date: Tue, 12 Mar 96 01:26:20 GMT
- Organization: none
- Message-ID: <826593980snz@genesis.demon.co.uk>
- References: <8BA8405.02C70020E1.uuout@sourcebbs.com> <4h6ara$mu@netnews1.apci.com> <825684095snz@genesis.demon.co.uk> <4i0sd4$7lr@peachy.apana.org.au>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <4i0sd4$7lr@peachy.apana.org.au>
- grahamb@peachy.apana.org.au "Graham Broadbridge" writes:
-
- >Lawrence Kirby (fred@genesis.demon.co.uk) wrote:
- >: In article <4h6ara$mu@netnews1.apci.com> wardmw@apci.com "Martin Ward"
- > writes:
- >
- >: >david.mohorn@sourcebbs.com (DAVID MOHORN) typed:
- >: >
- >: >>How do you feature out leap years? If its evenly divisible by 400 and
- >: >>4?
-
- Please take a little more care in trimming down your attributions.
-
- >I can't believe that anyone here can get confused about this.
- >
- >isleap(int year)
- >{
- >if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
- > printf("%d is a leap year", year);
- >else
- > printf("%d is not a leap year", year);
- >}
-
- Read the FAQ. The version it contains is slightly more efficient than this
- one.
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-